import java.util.Stack;

/**
 * @Description
 */

public class Test {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);

        int val = stack.pop();
        System.out.println(val);

        int val2 = stack.peek();
        System.out.println(val2);

        boolean empty = stack.empty();
        System.out.println(empty);

        //用栈实现逆序
       /* Node node = new Node(val);
        Node cur = head;
        while(cur!=null){
            stack.push(cur);
            cur = cur.next;
        }
        while(!stack.isEmpty()){
            System.out.println(stack.pop().val+" ");
        }

    }*/
    }
}
